package shejimoshi.diedaiqimoshi;

import java.util.ArrayList;
import java.util.List;

public class ConcreteAggregate implements Aggregate {
    private List<Integer> items=new ArrayList<>();


    @Override
    public Iterator getIterator() {
        return new ConcreteIterator(this);
    }

    @Override
    public void add(int item) {
        items.add(item);
    }

    public int get(int index) {
        return items.get(index);
    }

    public int size() {
        return items.size();
    }
}
